package PRUEBAS;
import java.util.StringTokenizer;

public class StringTokennizer {

	public static void main(final String args[]) {

//		int i;		
//		String line, word, subword;
//		StringTokenizer elementos, subelementos;
//		
//		line = "[[a,b],[c,d],[e,f]]";
//		
//		elementos = new StringTokenizer(line, "[]");
//		
//		while( elementos.hasMoreTokens() ) {
//			word = elementos.nextToken();
//			i = 1;
//			subelementos = new StringTokenizer(word, ",");
//			while( subelementos.hasMoreTokens() ) {
//				subword = subelementos.nextToken();
//				System.out.println(i + ". " + subword);
//				i++;
//			}
//		}
		
		String ids = "/Rochade/AP-DATA/S/REPOSITORIOS/00/NIL/NIL/REPO_APLICF_VERS/0/0/8625690"
					 + ",/Rochade/AP-DATA/S/REPOSITORIOS/00/NIL/NIL/REPO_APLICF_VERS/0/0/8233642"
					 + ",/Rochade/AP-DATA/S/REPOSITORIOS/00/NIL/NIL/REPO_APLICF_VERS/0/0/8233723";
		
		String param, element;
		StringTokenizer elementos, subelementos;
		
		elementos = new StringTokenizer(ids, ",");
		
		while( elementos.hasMoreTokens() ) {
			String res = ""; 
			param = elementos.nextToken();
			subelementos = new StringTokenizer(param, "/");
			for( int i = 0; subelementos.hasMoreTokens() ; i++ ) {
				element = subelementos.nextToken();
				//0/	  1/	  2/3/			 4/ 5/  6/  7/               8/9/10
				//Rochade/AP-DATA/S/REPOSITORIOS/00/NIL/NIL/REPO_APLICF_VERS/0/0/8233642
				switch( i ) {
					case 1:
						res += "DB: " + element ;
						break;
					case 2:
						res += ", App (type: " + element;						
						break;
					case 3:
						res += ", name: " + element;	
						break;
					case 4:
						res += ", version: " + element + ")";	
						break;
					case 7:
						res += ", Item (type: " + element;	
						break;
					case 10:
						res += ", id: " + element + ")";	
						break;
					default:
				}
			}
			System.out.println( res );
		}
	}
}